<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddFlashSaleDateToGoods extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('goods', function (Blueprint $table) {
            $table->dateTime("flash_sale_start_time")->nullable()->comment("秒杀开始时间");
            $table->dateTime("flash_sale_end_time")->nullable()->comment("秒杀结束时间");
            $table->integer("flash_sale_number")->default(0)->nullable()->comment("秒杀件数");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('goods', function (Blueprint $table) {
            $table->dropColumn("flash_sale_time");
            $table->dropColumn("flash_sale_number");
        });
    }
}
